<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>
<%String src = request.getParameter("src");%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<script src="<%=contextPath%>/ext3/ext-lang-zh_CN.js"></script>
 	<style>
		.icon_3 {
			background-image: url(<%=contextPath%>/images/time.gif)!important;
		}


 	
 	</style>
<script type="text/javascript">

	//屏蔽js错误 
 	function ResumeError() { return true; } window.onerror = ResumeError; 



var tabPanel;
Ext.onReady(function(){

    // 主面板（已有tab）   
     tabPanel = new Ext.TabPanel({   
        region:'center',   
        deferredRender:false,   
        autoScroll: true,    
        margins:'0 4 4 0',   
        activeTab:0,   
        // 激活前判断
		listeners:{"tabchange":function(Tabs, tab){ 
			setActiveTab(tab);
        }},
        items:[{   
            	id:'hzTab',   
            	title: '工作任务单', 
            	iconCls:'icon_3',
            	closable:false,
            	autoScroll:true,
				html:'<iframe id="ifrmHz" src="<%=contextPath%>/<%=src%>" width="100%" height="1000" frameborder="0" scrolling="no"></iframe>'  
        	}] 
    });   
    //  配置视图viewport   
    viewport = new Ext.Viewport({   
           layout:'border',   
           items:[tabPanel]
	});
});    

	function addTab(tabTitle, targetUrl, tab_num){   
	
	    var idstr = 'detail_tabPanel'+ tab_num;
	
		// 如果不存在新建一个, 如果存在让这个tab激活
	    if (tabPanel.getItem(idstr) == null || tabPanel.getItem(idstr) == undefined) {
	     
	        tabPanel.add({   
		        id:idstr,   
		        title: tabTitle,   
		        iconCls: 'tabs',
				closable:true,	
		        autoScroll:true,  
		        //autoLoad: {url: targetUrl, callback: this.initSearch, scope: this},   
		        html:'<div scrolling="no" style= "overflow:hidden"><iframe src="'+targetUrl+'" width="100%" height="100%" frameborder="0" scrolling="no"></iframe></div>'
		        
	       }).show();   
	
	    } else {
	        var tempTab = tabPanel.getItem(idstr);
	    	tabPanel.setActiveTab(tempTab);
	    }
	}
    // tab变化时触发事件
	function setActiveTab(tab) {
		var isMSIE= (navigator.appName == "Microsoft Internet Explorer");  //判断浏览器 
        if (isMSIE) {
			
			if (tab.id == "lsglTab" && window.document.getElementById("ifrmLsgl").src == "") {
	 			window.document.getElementById("ifrmLsgl").src = "<%=contextPath%>/plan!getGzapList.do?datafrom=3";
	 		} 
	 	} else {
			window.document.getElementById("ifrmGzzlkh").src = "<%=contextPath%>/plan!getGzapList.do?datafrom=3";
		}
		
		
	}

</script>  
<body class="standard" topmargin="0" leftmargin="0"> 
</body>  
</HEAD> 
</HTML>  